Merged
Conversation
* Fix MCPStreamableHTTPTool auth headers not being passed correctly * code review * code review * Add unit tests for httpx client configuration in MCP tool registration Tests verify that: - Authorization header is set on httpx.AsyncClient - User-Agent header is set on httpx.AsyncClient - MCP_HTTP_CLIENT_TIMEOUT_SECONDS constant (90s) is used - MCPStreamableHTTPTool receives http_client param (not headers) - httpx clients are tracked in _http_clients for cleanup - cleanup() properly closes all httpx clients These tests prevent regression to the bug where passing headers directly to MCPStreamableHTTPTool was silently ignored. * Add end-to-end httpx client lifecycle tests New TestHttpxClientLifecycle class with 4 tests: - test_full_client_lifecycle_single_server: verifies client created by add_tool_servers_to_agent() is properly closed by cleanup() - test_full_client_lifecycle_multiple_servers: verifies all clients are tracked and cleaned up when multiple MCP servers are configured - test_cleanup_idempotent_no_clients: verifies cleanup() is safe when no clients exist - test_cleanup_called_twice_after_creating_clients: verifies calling cleanup() multiple times doesn't cause issues These tests ensure connection/file-descriptor leaks are prevented by verifying the full client lifecycle from creation to cleanup. * Add httpx as runtime dependency for agentframework tooling extension httpx is now used directly in mcp_tool_registration_service.py to create AsyncClient instances with pre-configured headers. Without this explicit dependency, consumers could hit ModuleNotFoundError if httpx isn't available through transitive dependencies. * Fix linting issues in MCP tool registration tests - Remove unused httpx import - Remove unused mock_mcp_tool variable assignments - Sort imports properly - Remove trailing whitespace from blank lines * Apply ruff formatting to test file --------- Co-authored-by: Josina Joy <josjoy@microsoft.com>
* add sk attribute enrichment * organize code and fix test * add tests * address copilot review * address the PR comment --------- Co-authored-by: Nikhil Chitlur Navakiran (from Dev Box) <nikhilc@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Branch merger. Keeping code up-to-date.